Ein App-GeoFeature-Objekt, oder formal ein App::GeoFeature
, ist die Basisklasse der meisten Objekte, die geometrische Elemente in der 3D-Ansicht anzeigen, da es eine Daten-EigenschaftPlacement enthält.
Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten in FreeCAD
Das App GeoFeature ist ein internes Objekt; es kann daher nicht von der grafischen Oberfläche aus erstellt werden. Es ist generell nicht dafür vorgesehen, direkt eingesetzt zu werden, eher zum Ableiten einer Unterklasse für ein nacktes Objekt, das nur eine grundlegende Daten-EigenschaftPlacement enthält, die seine Position in der 3D-Ansicht festlegt.
Einige der wichtigsten abgeleiteten Objekte sind folgende:
Wird dieses Objekt mit Python erstellt, sollte anstatt eine Unterklasse von App::GeoFeature
abzuleiten, eine Unterklasse von App::GeometryPython
abgeleitet werden, da letztere einen Standard-Viewprovider enthält sowie Proxy
-Attribute für das Objekt selbst und seinen Viewprovider. Siehe Skripten.
Siehe Objekteigenschaften für alle Arten von Eigenschaften, die skriptgenerierte Objekte besitzen können.
Das Objekt App GeoFeature (Klasse App::GeoFeature
) ist von dem grundlegenden App DocumentObject (Klasse App::DocumentObject
) abgeleitet und erbt alle seine Eigenschaften. Zusätzlich besitzt es eine Daten-EigenschaftPlacement, die seine Position in der 3D-Ansicht bestimmt.
Siehe Objekteigenschaften für alle Arten von Eigenschaften, die skriptgenerierte Objekte besitzen können.
Das Objekt App GeometryPython (Klasse App::GeometryPython
) wird von einem App GeoFeature (Klasse App::GeoFeature
) abgeleitet und erbt alle seine Eigenschaften. Es besitzt einige zusätzliche Eigenschaften.
Diese sind die im Eigenschafteneditor vorhandenen Eigenschaften. Ausgeblendete Eigenschaften können mit dem Befehl Alle anzeigen im Kontextmenü des Eigenschafteneditors angezeigt werden.
Basis
PythonObject
): a custom class associated with this object.Placement
): the position of the object in the 3D view. The placement is defined by a Base
point (vector), and a Rotation
(axis and angle). See Placement.
0°
(zero degrees).0
and 1
. If any value is above 1
, the vector is normalized so that the magnitude of the vector is 1
. By default, it is the positive Z axis, (0, 0, 1)
.(0, 0, 0)
.String
): the user editable name of this object, it is an arbitrary UTF8 string.String
): a longer, user editable description of this object, it is an arbitrary UTF8 string that may include newlines. By default, it is an empty string ""
.ExpressionEngine
): a list of expressions. By default, it is empty []
.Bool
): whether to display the object or not.
Basis
PythonObject
): eine spezielle, mit diesen Objekt vebundene, Viewprovider-klasse.Display Options
Bool
): if it is true
, the object will show the bounding box in the 3D view.Enumeration
): see the information in App FeaturePython.Bool
): see the information in App FeaturePython.Bool
): see the information in App FeaturePython.Object Style
Color
): a tuple of three floating point RGB values (r,g,b)
to define the color of the faces in the 3D view; by default it is (0.8, 0.8, 0.8)
, which is displayed as [204, 204, 204]
on base 255, a light gray .Material
): an App Material associated with this object. By default it is empty.Percent
): an integer from 0
to 100
that determines the level of transparency of the faces in the 3D view. A value of 100
indicates completely invisible faces; the faces are invisible but they can still be picked as long as AnsichtSelectable is true
.Selection
Enumeration
): see the information in App FeaturePython.Bool
): if it is true
, the object can be picked with the pointer in the 3D view. Otherwise, the object cannot be selected until this option is set to true
.Enumeration
): see the information in App FeaturePython.
Siehe auch: FreeCAD Grundlagen Skripten und Skriptgenerierte Objekte.
Siehe Part Formelement für allgemeine Informationen zum Hinzufügen von Objekten zu einem Dokument.
Ein GeoFeature wird mit der Methode addObject()
des Dokuments erstellt. Soll ein Objekt mit einer 2D- oder 3D- Topoform erstellt werden, ist es vielleicht besser, eine Unterklasse zu erstellen, die auf den Umgang mit Formen spezialisiert ist, z.B. Part Fomelement oder Part Part2DObject.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::GeoFeature", "Name")
obj.Label = "Custom label"
Für die Ableitung von Python-Unterklassen sollte das App::GeometryPython
-Objekt erstellt werden.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::GeometryPython", "Name")
obj.Label = "Custom label"